package com.spring02.demo.testenum;
//final 不允许被继承
public final class HungerSingleton {
    private static HungerSingleton instance=new HungerSingleton();
    //私有构造函数不允许外部new
    private HungerSingleton(){}
    //提供一个方法给外部调用
    public static HungerSingleton getInstance(){
        return instance;
    }
}
